#ifndef __TASK_QUEUE__
#define __TASK_QUEUE__
#include <func.h>
typedef struct cmd_s{
    char object[256];//命令的操作对象
    int token;//命令类型
    off_t offset;
} cmd_t;

typedef struct task_s{
    cmd_t command;
    int netfd;
    struct task_s *pNext;
} task_t;
typedef struct taskQueue_s{
    task_t *pFront;
    task_t *pRear;
    int queueSize;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
} taskQueue_t;
int taskQueueInit(taskQueue_t *ptaskQueue);
int taskEnQueue(taskQueue_t *ptaskQueue, cmd_t Cmd, int netfd);
int taskDeQueue(taskQueue_t *ptaskQueue);
#endif